package com.tanglongan.designPattern.dp18_observer.demo01;

public class Client {
    public static void main(String[] args) {
        Csdn csdn = Csdn.getInstance();
        Teacher tom = new Teacher("Tom");
        Teacher jerry = new Teacher("Jerry");

        csdn.addObserver(tom);
        csdn.addObserver(jerry);

        Question question = new Question();
        question.setUserName("张三");
        question.setContent("观察者模式适用于哪些场景？");
        csdn.publishQuestion(question);
    }
}
